package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.domain.Menu;
import org.example.vo.MenuVo;

import java.util.List;

/**
* @author 14168
* @description 针对表【sys_menu】的数据库操作Mapper
* @createDate 2024-05-22 19:07:25
* @Entity org.example.domain.Menu
*/
@Mapper
public interface MenuMapper {

    List<MenuVo> list(Integer userId);

    List<MenuVo> listAll(Menu menu);

    boolean save(Menu menu);

    @Delete("delete from sys_menu where id=#{id} or parent_id=#{id}")
    void remove(Integer id);

    void update(Menu menu);

    @Select("select * from sys_menu where name=#{name}")
    Menu getByName(String name);
}




